home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_066 / foogol / test.foo < prev    next >
Text File  |  1992-05-06  |  547b  |  22 lines

  1. begin
  2.   integer n, div, sub, test, testcopy, found, max;
  3.   test := 2; max := 10; /* number of primes wanted */
  4.   while n # max do begin
  5.     div:= test-1; found:= 0;
  6.     while div-1 do begin
  7.       testcopy:= test; sub:= 0;
  8.       while testcopy do begin
  9.         sub:= sub+1; if sub = div then sub:= 0;
  10.         testcopy:= testcopy-1
  11.       end;
  12.       if sub = 0 then found:= 1;
  13.       div:= div-1
  14.     end;
  15.     if found = 0 then begin
  16.       n:= n+1;
  17.       printn(test); prints(" is prime number "); printn(n); print
  18.     end;
  19.     test:= test+1
  20.   end
  21. end
  22.